<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>迁移任务</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="assets/libs/layui/css/layui.css">
    <link rel="stylesheet" href="assets/css/scroll-bar.css">
    <link rel="stylesheet" href="assets/css/sub-page.css">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_693759_hsptnwurztv.css">
</head>
<body>
<div class="ok-body">
    <!--面包屑导航区域-->
    <div class="ok-body-breadcrumb">
            <span class="layui-breadcrumb">
                <a><cite>首页</cite></a>
                <a><cite>数据迁移</cite></a>
                <a><cite>脱敏设置</cite></a>
            </span>
        <a class="layui-btn layui-btn-small" href="javascript:location.replace(location.href);" title="刷新">
            <i class="layui-icon layui-icon-refresh"></i>
        </a>
    </div>

    <table class="layui-hide" id="mask-table" lay-filter="mask_table"></table>
    <script type="text/html" id="mask-tool">
        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="mask">设置</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="clear">清除</a>
    </script>


    <div id="mask-form" style="display: none">

    </div>

</div>
<script src="assets/libs/layui/layui.js"></script>
<script>
    layui.config({
        base: 'module/',
        version: true,
        debug: true
    }).use(['table','config', 'crown'], function () {
        var table = layui.table;
        var crown = layui.crown;
        var config = layui.config;

        var task_id = ${taskId};

        table.render({
            elem: '#mask-table',
            page: true,
            request: config.request,
            parseData: config.parseData,
            response: config.response,
            cellMinWidth: 120,
            width: '80%',
            url: '/task/masks/'+task_id,
            cols: [[
                {field: 'tableName', align: 'center', width:180, title: '表名'},
                {toolbar:'#mask-tool', align: 'center', title: '操作'}
            ]]
        });

        table.on('tool(mask_table)', function (obj) {
            var data = obj.data;
            var layEvent = obj.event;
            crown.putTempData('t_mask', data);
            if(layEvent === 'mask'){
                crown.popupCenter({
                    title:  '添加数据库',
                    path: 'pages/mask-form.html',
                    finish: function () {

                    }
                });
            }else if(layEvent === 'clear'){

            }
        });
    });
</script>

</body>
</html>